/**
 * 1
 *  
 * @Author : Ruoyu Wang
 * @DateTime : 24-10-28 下午6:57
 */

#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    double res = 0.0, x;
    while (n--) {
        cin >> x;
        res += max(x, 1 - x);
    }
    cout << res;
    return 0;
}